<?xml version="1.0" encoding="UTF-8" ?>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="/tag/sys" prefix="sys"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<base href="<sys:baseUrl/>" />
<link rel="Stylesheet" href="style/common.css" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Goods List</title>
<script>
function choose(form,id,name,price){
	var amount=form.amount.value;
	var regNum =/^\d*$/;
	if(!regNum.test(amount)){
		alert('数量必须为数字');
		return;
	}
	parent.choose_done(name,id,amount,price);
}

function load(){
	var location=window.location+"";
	document.forms[0].action="sale/returnChoose?pid="+location.substring(location.length-10);
}
</script>
</head>
<body onload="load()">
	<div class="input_area" style="width: 500px">
		<form action="sale/returnChoose" method="post">
			品名<input name="name" size="15"/>&nbsp; 编号<input name="id" size="15"/>&nbsp; <input
				type="submit" value="查找商品" />
		</form>
		<br />
		<table width="100%">
			<tr>
				<th width="80px">编号</th>
				<th width="200px">品名</th>
				<th width="80px">单价</th>
				<th width="160px">操作</th>
			</tr>
			<c:forEach var="g" items="${goods}" varStatus="status">
				<tr <c:if test="${status.index%2==1}">class="even"</c:if>>
					<td>${g.id }</td>
					<td>${g.goodsname }</td>
					<td>${g.price }</td>
					<td>
						<form>
							<input id="amount" size="5" value="1" />&nbsp; <input
								type="button"
								onclick="return choose(this.form,'${g.id }','${g.goodsname }','${g.price }')"
								value="确认" />
						</form></td>
				</tr>
			</c:forEach>
		</table>
	</div>
</body>
</html>